package world.snowcrystal.controller;

import lombok.extern.log4j.Log4j2;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import world.snowcrystal.dto.ApplicationMessage;

@Log4j2
@Controller
@RequestMapping(value = "/", produces = MediaType.APPLICATION_JSON_VALUE)
public class ActionProcessingController {

    @GetMapping(value = "/")
    public ResponseEntity<ApplicationMessage<Void>> re() {
        return ResponseEntity.ok(ApplicationMessage.ok("ok"));
    }

    @PostMapping("/authentication")
    public ResponseEntity<ApplicationMessage<Void>> authentication() {
        return ResponseEntity.ok(ApplicationMessage.ok("ok"));
    }

    @PostMapping(value = "/logout")
    public ResponseEntity<ApplicationMessage> logout(
            @CookieValue(value = "fingerprint", required = false) String cfp) {





        return ResponseEntity.ok(ApplicationMessage.ok("logout"));
    }

}
